#include "../begonia.h"
#include "prebullet.h"
#include "../base/scene.h"

prebullet::prebullet(double delay,bool *ton,bullet *h):bullet(0.0,0.0,0.0,0.0,0.0,h)
{
    on=ton;
    if(on) *on=true;
    trealize=t+delay;
}
void prebullet::clone(bullet *h)
{
    prebullet *a=new prebullet(0.0,0,h);
    h2.next->clone(&a->h2);
    a->c_r=c_r;
    a->c_g=c_g;
    a->c_b=c_b;
}
bool prebullet::move()
{
    if(t>=trealize)
    {
        if(h2.next->next=f.head.next) h2.next->next->pre=h2.next;
        f.head.next=h2.next;
        h2.next->pre=&f.head;
        h2.next=h2.pre=&h2;
        remove();
        return false;
    }
    return true;
}
bool prebullet::judge()
{
    return false;
}
void prebullet::show()
{
    glColor3d(c_r,c_g,c_b);
    drawcircle2(h2.next->x,h2.next->y,h2.next->r);
}
int prebullet::incb()
{
    if(h2.next->incb()) return 1;
    return 0;
}
prebullet::~prebullet()
{
    if(on) *on=false;
}
